package cn.com.cifi.mars.mapper.mars;
import cn.com.cifi.mars.bean.vo.returnPlan.ReturnPlanGroupVo;
import cn.com.cifi.mars.bean.vo.returnPlan.ReturnTotalVo;
import cn.com.cifi.mars.entity.ReturnPlanVersionDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 回款计划版本明细表 Mapper 接口
 * </p>
 *
 * @author JingYuanXiang
 * @since 2020-11-06
 */
public interface ReturnPlanVersionDetailMapper extends BaseMapper<ReturnPlanVersionDetail> {

    List<String> selectYearListByVersionIdList(@Param("versionIdList") List<String> versionIdList,@Param("isDel") int isDel);

    void delByVersionId(@Param("versionId") String versionId, @Param("alias") String alias, @Param("isDel") int isDel);

    List<ReturnPlanGroupVo> selectReturnPlanGroupVoList(@Param("versionId") String versionId, @Param("isDel") int isDel);

    void delByGroupId(@Param("versionId") String versionId,@Param("groupId") String groupId, @Param("alias") String alias, @Param("isDel") int isDel);

    void insertList(@Param("list") List<ReturnPlanVersionDetail> detailList);

    List<ReturnTotalVo>  selectReturnTotal(@Param("versionIdList") List<String> versionIdList, @Param("year") String year);

    List<Double> selectYearFirstByid(@Param("versionIdList") List<String> versionIdList, @Param("yearMonth") String yearMonth);

    List<ReturnTotalVo> selectReturnTotalForTime(@Param("forwardTime") LocalDateTime forwardTime, @Param("now") LocalDateTime now, @Param("versionIdList") List<String> versionIdList);

    List<Double> selectYearFirstForTime(@Param("versionIdList") List<String> versionIdList, @Param("forwardTime") LocalDateTime forwardTime);

	void copyVersionDetail(@Param("sourceVersionId")String sourceVersionId, @Param("targetVersionId")String targetVersionId);
}
